package tr3dtris.game.persistence;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * @author Luciano
 */
public class Record implements Serializable, Comparable<Record>
{
    private String nick;
    private int points;
    private Date date;

    public Record(){}

    public Record(String nick, int points)
    {
        this.nick = nick;
        this.points = points;
        this.date = new Date();
    }

    public int compareTo(Record o) {
        return o.getPoints() - this.getPoints();
    }

    /**
     * @return the nick
     */
    public String getNick() {
        return nick;
    }

    /**
     * @param nick the nick to set
     */
    public void setNick(String nick) {
        this.nick = nick;
    }

    /**
     * @return the points
     */
    public int getPoints() {
        return points;
    }

    /**
     * @param points the points to set
     */
    public void setPoints(int points) {
        this.points = points;
    }

    /**
     * @return the date
     */
    public Date getDate() {
        return date;
    }

    /**
     * @param date the date to set
     */
    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public String toString()
    {
        return this.nick + ": " + this.points + " (" + this.date.toString() + ")";
    }


}
